# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=geth
pkgver=1.13.8
pkgrel=0
pkgdesc="Official Go implementation of the Ethereum protocol"
url="https://geth.ethereum.org/"
arch="all"
license="LGPL-3.0-or-later"
makedepends="go linux-headers"
checkdepends="fuse"
options="!check chmod-clean net"
source="$pkgname-$pkgver.tar.gz::https://github.com/ethereum/go-ethereum/archive/v$pkgver.tar.gz"
builddir="$srcdir/go-ethereum-$pkgver"

# secfixes:
#   1.10.22-r0:
#     - CVE-2022-37450

export GOROOT=/usr/lib/go
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	make
}

check() {
	make test
}

package() {
	mkdir -p "$pkgdir"/usr/bin
	install -m755 -t "$pkgdir"/usr/bin build/bin/*
}

sha512sums="
bb49124a516c57da2e8cdf377a74bb6fdba76f119fdcc7995991b6e1394448dec482de8c4efe2c0380f64ff8c8447e556ee4fde843c1729f0be185ae29deb136  geth-1.13.8.tar.gz
"
